package com.peking.donations.plugins.pay.wx.utils;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * User: rizenguo Date: 2014/10/29 Time: 14:40 这里放置各种配置数据
 */
@Component
@ConfigurationProperties(prefix = "global")
public class GlobalConfigure {

    private String appID;

    private String hostname;

    private String hostip;
    private String encryptkey;

    private String encryptsecret;


    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    public String getHostip() {
        return hostip;
    }

    public void setHostip(String hostip) {
        this.hostip = hostip;
    }

    public String getEncryptkey() {
        return encryptkey;
    }

    public void setEncryptkey(String encryptkey) {
        this.encryptkey = encryptkey;
    }

    public String getEncryptsecret() {
        return encryptsecret;
    }

    public void setEncryptsecret(String encryptsecret) {
        this.encryptsecret = encryptsecret;
    }


    public String getAppID() {
        return appID;
    }

    public void setAppID(String appID) {
        this.appID = appID;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GlobalConfigure that = (GlobalConfigure) o;

        if (hostname != null ? !hostname.equals(that.hostname) : that.hostname != null) return false;
        if (hostip != null ? !hostip.equals(that.hostip) : that.hostip != null) return false;
        if (encryptkey != null ? !encryptkey.equals(that.encryptkey) : that.encryptkey != null) return false;
        return encryptsecret != null ? encryptsecret.equals(that.encryptsecret) : that.encryptsecret == null;

    }

    @Override
    public int hashCode() {
        int result = hostname != null ? hostname.hashCode() : 0;
        result = 31 * result + (hostip != null ? hostip.hashCode() : 0);
        result = 31 * result + (encryptkey != null ? encryptkey.hashCode() : 0);
        result = 31 * result + (encryptsecret != null ? encryptsecret.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "GlobalConfigure{" +
                "hostname='" + hostname + '\'' +
                ", hostip='" + hostip + '\'' +
                ", encryptkey='" + encryptkey + '\'' +
                ", encryptsecret='" + encryptsecret + '\'' +
                '}';
    }
}
